package com.weishaoying.example.base.aware;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

/**
 * @author WeiShaoying
 * @date 2018/4/4
 */
public class Test {
    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
//        AwareService awareService = context.getBean(AwareService.class);
//        awareService.print();
//        context.close();
//        System.out.println("=====\n");
        //AnnotationConfigApplicationContext@2a33fae0 has been closed already



        AwareService bean = SpringContextUtil.getBean(AwareService.class);
        bean.print();
    }
}
